import unittest
from handler.Rest import Rest


class test_Rest(unittest.TestCase):
	def test_get(self):
		content = {
			'name': 'Rest',
			'handler': 'rest',
			'parameters': {'token': '', 'username': 'john', 'password': 'doh'},
			'begin': [{
				'url': 'http://127.0.0.1:5000/',
				'verb': 'post',
				'headers': [],
				'data': {
					'username': '$username',
					'password': '$password',
				},
				'response': {
					'data': {
						'token': '$token',
					}
				}
			}],
			'before': [],
			'state': [],
			'after': [],
			'end': [],
		}

		rest = Rest(content)
		rest.change_state('off', 'on')
